//
//  AuthenTableViewCell.m
//  HxgProject
//
//  Created by hxg on 2018/3/6.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "AuthenTableViewCell.h"

#define personIconSize [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PR_del_reviewer"]].frame.size
#define spaceW 15.0f

@implementation AuthenTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self)
    {
        [self setUpUI];
    }
    
    return self;
}

- (void)setUpUI
{
    [self.contentView addSubview:self.personIcon];
    [self.personIcon makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).offset(36.0f);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(personIconSize.width, personIconSize.height));
    }];
    
    [self.contentView addSubview:self.titleNameLbl];
    self.titleNameLbl.font = [UIFont systemFontOfSize:14.0f];

    [self.titleNameLbl makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.personIcon.mas_top);
        make.left.equalTo(self.personIcon.mas_right).offset(spaceW);
    }];
    
    [self.contentView addSubview:self.desLbl];
    self.desLbl.text = @"请如实填写个人信息";
    [self.desLbl makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleNameLbl.mas_bottom).offset(3.0f);
        make.left.equalTo(self.personIcon.mas_right).offset(spaceW);
    }];
    
    [self.contentView addSubview:self.authenLbl];
    self.authenLbl.text = @"未认证";
    [self.authenLbl makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-20.0f);
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
    
    
}

#pragma mark - getter、setter
-(UIImageView *)personIcon
{
    if (!_personIcon)
    {
        _personIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"PR_del_reviewer"]];
    }
    
    return _personIcon;
}

-(UILabel *)titleNameLbl
{
    if (!_titleNameLbl)
    {
        _titleNameLbl = [[UILabel alloc] init];
        _titleNameLbl.font = cellDesFont;
    }
    
    return _titleNameLbl;
}

-(UILabel *)desLbl
{
    if (!_desLbl)
    {
        _desLbl = [[UILabel alloc] init];
        _desLbl.font = cellDesFont;
        _desLbl.textColor = fontGrayColor;
        _desLbl.textAlignment = NSTextAlignmentLeft;
    }
    
    return _desLbl;
}

-(UILabel *)authenLbl
{
    if (!_authenLbl)
    {
        _authenLbl = [[UILabel alloc] init];
        _authenLbl.textColor = [UIColor colorWithHexString:@"ef3d07"];
        _authenLbl.textAlignment = NSTextAlignmentRight;
        _authenLbl.font = cellAuthenFont;
    }
    return _authenLbl;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
